#coding:utf-8
from django.http.response import HttpResponseRedirect
from django.shortcuts import render_to_response
from django.template.context import RequestContext
from lovewith.views import site_info


#获取目标分类下的灵感数据
def show_topic(request, year=2013, template_name=None):
    #找不到模板
    if not template_name:
        return HttpResponseRedirect('/')

    template_path = 'magazine/%s/%s.jinja' % (year, template_name)

    try:
        response = render_to_response(template_path, {

        }, context_instance=RequestContext(request, processors=[site_info]))
        return response
    except StandardError, api_error:
        return HttpResponseRedirect('/')